<div class="bigtitle">Dự án &gt; Cập nhật</div>
<table class='tblcontent' cellspacing='0' cellpadding='0' border='0'>
	<tr>
		<td>
			<?=form_open_multipart(site_url('xay_dung/update'),array('name'=>'frm','onsubmit'=>'return f_validate()'),array('hidden_status'=>'','hidden_id'=>$detail->id))?>			
			<table class='tblinputform' cellspacing='1' cellpadding='2' border='0' width='100%'>
                <tr>
					<th width='10%'>Nhóm</th>
					<td width='90%'>
						<select name='cbo_category'>
							<option value="0">Chọn nhóm dự án</option>
							<? for($i=0;$i<count($category);$i++){ ?>
							<option value="<?=$category[$i]->id?>" <?=($detail->categoryid==$category[$i]->id?'selected="selected"':'')?>><?=form_prep($category[$i]->name)?></option>
							<? } ?>
						</select>
					</td>
				</tr>
				<tr>
					<th>Hình cũ</th>
					<td><img width="120" height="100" src="<?=base_url().$this->config->item('project_img_path').$detail->image?>" /></td>
				</tr>
                <tr>
					<th><?=lang('news_image')?></th>
					<td><input type="file" name="txt_image" size="20"/></td>
				</tr>
				<tr>
					<th>Tên dự án</th>
					<td><input type='text' name='txt_name' style='width:890px;' maxlength='200' value='<?=htmlspecialchars($detail->name)?>' /></td>
				</tr>
                <tr>
					<th>Khu vực</th>
					<td><input type='text' name='txt_location' style='width:890px;' maxlength='200' value='<?=htmlspecialchars($detail->location)?>' /></td>
				</tr>
				<tr>
					<th>Mô tả</th>
					<td><textarea name='txt_sumary' style='width:890px;height:100px;'><?=htmlspecialchars($detail->sumary)?></textarea></td>
				</tr>
                <tr>
					<th>Quy mô</th>
					<td><textarea name='txt_scale' style='width:890px;height:100px;'><?=htmlspecialchars($detail->scale)?></textarea></td>
				</tr>
                <tr>
					<th>Tiện ích</th>
					<td><textarea name='txt_utility' style='width:890px;height:100px;'><?=htmlspecialchars($detail->utility)?></textarea></td>
				</tr>
                <tr>
					<th>Chi tiết</th>
					<td><?=form_fckeditor('txt_content',$detail->description,500)?></td>
				</tr>
			</table>
			<div class='ctrlbtn'>
				<input type='button' name='btn_save' value='<?=lang('label_save')?>' onclick='return f_validate()'/>	
				<input type='button' name='btn_cancel' value='<?=lang('label_cancel')?>' onclick='window.location="<?=site_url('xay_dung')?>";'/>
			</div>
			<?=form_close()?>
		</td>
	</tr>
</table>
<script type='text/javascript'>
	f_onload();
	function f_onload(){ document.frm.cbo_category.focus();}
	function f_validate(){
		form = document.frm;
		if( form.cbo_category  && form.cbo_category.value==0){
			alert("Vui lòng chọn nhóm dự án");
			form.cbo_category.focus();
			return false;
		}
		form.submit();
	}
</script>